public class BuilderPattern {
    public static void main(String[] args) {
        Computer laptop = new desktop();
        Director director = new Director(laptop);
        director.build();
    }
}

class Director {
    private Computer computer;

    public Director(Computer computer) {
        this.computer = computer;
    }

    public void build() {
        computer.moniter();
        computer.machine();
        computer.peripheral();
    }

}

abstract class Computer {
    abstract void moniter();

    abstract void machine();

    abstract void peripheral();

}

class laptop extends Computer {

    @Override
    void moniter() {
        System.out.println("laptop moniter");
    }

    @Override
    void machine() {
        System.out.println("laptop machine");
    }

    @Override
    void peripheral() {
        System.out.println("laptop peripheral");
    }

}

class desktop extends Computer {

    @Override
    void moniter() {
        System.out.println("desktop moniter");
    }

    @Override
    void machine() {
        System.out.println("desktop machine");
    }

    @Override
    void peripheral() {
        System.out.println("desktop peripheral");
    }

}